package com.ler.nacosconsumer;

import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author lww
 * @date 2019-08-24 15:36
 */
@Slf4j
@RestController
public class ConsumerController {

	//直接注入使用
	@Resource
	private RestTemplate restTemplate;

	@GetMapping("/test")
	public String test() {
		//alibaba-nacos-provider 服务名
		//hello 接口
		//name 参数
		return restTemplate.getForObject("http://alibaba-nacos-provider/hello?name=lerderlerder", String.class);
	}
}
